When digital signals are transmitted across electrical connections, integrity of the digital signal typically is verified to ensure that information was not lost in transmission. Various methods exist for performing verification on digitally transmitted data, including use of parity bits, checksums, and special data coding methods.
One such data verification method is the one's complement checksum widely used in network communication via the Internet Protocol (IP), and which forms a part of the IP protocol layer definition for IP header packets (see Request for Comments RFC 1071, Network Working Group). The idea behind the IP checksum centers around addition of the transmitted words, and transmitting an indication of the sum or checksum. Upon receipt of the data, the receiver performs the same calculation on the received data and compares the result with an expected result.
In the specific application of IP headers, the one's complement sum of checksummed bytes is itself the checksum. Upon receipt of the IP header, the sum of checksummed bytes is again calculated, and the resulting sum is added to the received checksum. Because the received checksum and the computed sum of received bytes should be one's complements of each other, adding the received checksum and the computed sum together should result in a byte that is all 1's. Therefore, if all data received, including the one's complement checksum, is added, the result should be all 1's, or FFFF in the case of IP header checksum computation. One's complement checksums are similarly utilized in Terminal Control Program (TCP), User Datagram Protocol (UDP), and many other protocols and systems.
Unfortunately, calculation of a checksum for both transmitted and received data typically requires that a number of mathematical functions be performed in a processor, delaying packet coding or verification until the checksum is computed. Further, processing capability to calculate the checksum must be built into the appropriate communications device, often requiring significant power and integrated circuit die space.
A one's complement checksum calculation that is efficient to implement and operate is therefore desirable.